﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace DataModels.Models
{
    /// <summary>
    /// This hold region information of the region existing in other system with
    /// different name and identification names
    /// </summary>
    public class OtherSystemsRegionDetail : ModelBase
    {
        [Key, Column(Order = 0)]
        public int SystemId { get; set; }

        [Key, Column(Order = 1)]
        public int InternalRegionId { get; set; }

        [Required]
        [StringLength(50)]
        public string RegionCode { get; set; }

        private string _RegionName;
        [Required]
        [StringLength(255)]
        public string RegionName
        {
            get { return _RegionName; }
            set
            {
                _RegionName = value;
                OnPropertyChanged("RegionName");
            }
        }

        // Navigation properties
        [ForeignKey("SystemId")]
        public virtual OtherSystem OtherSystem { get; set; }

        [ForeignKey("InternalRegionId")]
        public virtual Region Region { get; set; }
    }
}
